package com.yc.cloud.openai.portal.factory;

import java.util.EnumMap;
import java.util.Map;

import org.springframework.stereotype.Component;

import com.yc.cloud.openai.portal.dao.VideoClient;
import com.yc.cloud.openai.portal.enums.VideoProvider;

@Component
public class VideoClientFactory {

    private final Map<VideoProvider, VideoClient> clientMap = new EnumMap<>(VideoProvider.class);

    public VideoClientFactory(Map<String, VideoClient> clientBeans) {
        // 使用枚举的 value 作为键来初始化 Map
        clientBeans.forEach((name, client) -> clientMap.put(VideoProvider.valueOf(name), client));
    }

    public Map<VideoProvider, VideoClient> getClientMap() {
        return clientMap;
    }
}
